home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _GUICtrlComboGetDroppedState.au3 < prev    next >
Text File  |  2006-06-17  |  942b  |  33 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiCombo.au3>
  3.  
  4. Opt('MustDeclareVars',1)
  5.  
  6. Dim $Combo,$Btn_Exit,$Status,$msg,$state,$current
  7.  
  8. GuiCreate("ComboBox Dropped State", 392, 254)
  9.  
  10. $Combo = GuiCtrlCreateCombo("", 70, 10, 270, 120)
  11. GUICtrlSetData($Combo,"AutoIt|v3|is|freeware|BASIC-like|scripting|language")
  12. $Btn_Exit = GuiCtrlCreateButton("Exit", 150, 180, 90, 30)
  13. $Status = GUICtrlCreateLabel("",0,234,392,20,BitOR($SS_SUNKEN,$SS_CENTER))
  14. GUICtrlSetData($Status,"Dropped State: False")
  15. GuiSetState()
  16. While 1
  17.     $msg = GuiGetMsg()
  18.     Select
  19.         Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  20.             ExitLoop
  21.         Case Else
  22.             $state = _GUICtrlComboGetDroppedState($Combo)
  23.             If($state And $state <> $current) Then
  24.                 $current = $state
  25.                 GUICtrlSetData($Status,"Dropped State: True")
  26.             ElseIf($state <> $current) Then
  27.                 $current = $state
  28.                 GUICtrlSetData($Status,"Dropped State: False")
  29.             EndIf
  30.     EndSelect
  31. WEnd
  32. Exit
  33.